const person = {
    firstName: 'John',
    lastName: 'Doe',
}

const handler = {
    get(target, prop) {
        console.log(`Getting ${prop}: ${target[prop]}`)
        return Reflect.get(target, prop)
    },
    set(target, prop, value) {
        console.log(`Setting ${prop}: ${target[prop]}`)
        return Reflect.set(target, prop, value);
    }
}

const personProxy = new Proxy(person, handler);

console.log(personProxy.firstName);